clear all; close all; clc;
R = 47;
L = 100e-6;


W = R/L;
F = W/(2*pi);


T = 1/(10000*F);
t = 0:T:(15 * 1/F); 
lt = length(t);

UR = nan(1,lt);
UL = nan(1,lt);
I = nan(1,lt);
dI = nan(1,lt);

stdn = sqrt(13);
E = stdn*randn(1, lt);  

 

Ul(1)=0;
I(1)=0;
dI(1)=Ul(1)/L;
UR(1)=0;

for k =2:lt
    Ul(k)=E(k)-UR(k-1);
    dI(k)=Ul(k)/L;
    I(k)=I(k-1)+dI(k-1)*T;
    UR(k)=I(k)*R;    
end

figure(1);
plot(t*1e9, [E; UR]); 
xlabel('t,ns')
ylabel('U_R, E,U,Volt') 
grid on

    
